home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / sudo-1.000 / sudo-1 / sudo-1.2 / visudoers / visudo.lex < prev    next >
Text File  |  1993-12-05  |  2KB  |  58 lines

  1. %{
  2. /*
  3.  *  sudo version 1.1 allows users to execute commands as root
  4.  *  Copyright (C) 1991  The Root Group, Inc.
  5.  *
  6.  *  This program is free software; you can redistribute it and/or modify
  7.  *  it under the terms of the GNU General Public License as published by
  8.  *  the Free Software Foundation; either version 1, or (at your option)
  9.  *  any later version.
  10.  *
  11.  *  This program is distributed in the hope that it will be useful,
  12.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  *  GNU General Public License for more details.
  15.  *
  16.  *  You should have received a copy of the GNU General Public License
  17.  *  along with this program; if not, write to the Free Software
  18.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  *
  20.  *  If you make modifications to the source, we would be happy to have
  21.  *  them to include in future releases.  Feel free to send them to:
  22.  *      Jeff Nieusma                       nieusma@rootgroup.com
  23.  *      3959 Arbol CT                      (303) 447-8093
  24.  *      Boulder, CO 80301-1752             
  25.  */
  26. /*******************************************************************************
  27. * parse.lex, sudo project
  28. * David R. Hieb
  29. * March 18, 1991
  30. *
  31. * Lex Specification file for the sudo project.
  32. *******************************************************************************/
  33. #include "sudo.h"
  34. #include "y.tab.h"
  35. int yylineno;
  36. %}
  37.  
  38. %%
  39. [ \t]+            { ; }                     /* throw away space/tabs */
  40. \\\n            { yylineno++; }           /* throw away EOL after \ */
  41. \,            { return ','; }           /* return ',' */
  42. \!            { return '!'; }           /* return '!' */
  43. =            { return '='; }           /* return '=' */
  44. :            { return ':'; }           /* return ':' */
  45. \n            { yylineno++;
  46.               return COMMENT; }       /* return newline */
  47. #.*\n            { yylineno++;
  48.               return COMMENT; }       /* return comments */
  49. [@$%^&*()"'`/_+]*    { return ERROR; }         /* return error */
  50. [?;<>\[\]{}|~.-]*    { return ERROR; }         /* return error */
  51. ^[a-zA-Z0-9_-]+        { fill(); return IDENT1;} /* user/{Host,Cmnd}_Alias */
  52. [a-zA-Z0-9_.+-]+    { fill(); return IDENT2;} /* host_type/ALIASES */
  53. (\/[a-zA-Z0-9_.+-]+)+    { fill(); return IDENT3;} /* absolute command path */
  54. %%
  55. fill() {
  56. strcpy(yylval.char_val, yytext);
  57. }
  58.